<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // let x = 1; // 变量定义+赋值运算
      let x, y;
      x = 1; // 赋值运算
      y = 2; // 赋值运算

      const sum = (y = 2); //sum=2

      // const z = x + y;
      const z = (x = 1) + (y = 2) + sum;
      console.log(z); //3
    </script>
  </body>
</html>
